-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable use of ocamldebug #811
Conversation
ah, the CI is unhappy 😅 , it's late now, so I'll fix that tomorrow |
I am wondering if there is any way to force dune to generate bytecode if you do I think you could then do something like
in the install stanza, which would install whatever is generated. I'm not sure why loadfile_private shouldn't work. There is also a function |
Aha, yeah that's a much neater solution. I have switched to using I've pushed these changes to the PR just to get the tests running to see if that fixes any of the errors introduced. I'll look at the dune docs while I wait for that to run, to see if there's a way to choose between bytecode and native |
a94eabb
to
0978e43
Compare
looks like I couldn't find a way to make dune build native by default and have an option to use bytecode, so I've left the dune config as-is. There appears to be no significant impact on build time, so it's probably easiest just to leave it like that? This is probably ready for another look. |
This introduces a few changes: 1. the dune config is changed to generate bytecode objects for all modules 2. sail can now load bytecode plugins, and will do so when the main sail program is running from bytecode 3. adds a wrapper called debug_sail which runs ocamldebug with the right environment
I think this looks good. I'll probably give it a try myself then merge it tomorrow. |
This introduces a few changes:
debug_sail
which runs ocamldebug with the right options and environment to make it workSome things that are worth detailed review:
I had to change
Dynlink.loadfile_private
toDynlink.loadfile
. I'm not entirely sure the consequences of this, but it didn't work with the_private
version. Is this expected? (scr/bin/sail.ml:151
)In
src/bin/sail.ml:588
there is some special-case parsing of command line arguments, because the full parsing normally happens after the plugins are loaded, but this particular option needs parsing before and plugins can load. Is there a better way to do this?I'm not very familiar with dune, so I'm not sure if the changes I've made to the config are best-practice.